package com.sicheng.metadata.juc.jmm;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

public class JMM {

    private static final AtomicInteger num = new AtomicInteger(0);

    public static void main(String[] args) {
        new Thread(() -> {
            while (num.intValue() == 0) {

            }
        }).start();
        try {
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        num.incrementAndGet();
        System.out.println(num);

    }

}
